Skip to content

fix: asynchronously destroy items evicted on clearHistory navigation #847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 12, 2017

Conversation

buuhuu
Copy link
Contributor

@buuhuu buuhuu commented Jun 15, 2017

  • queue items eligible to be destroyed on clearRefCache instead of destroying them immediately
  • finally destroy them on navigatedFrom event

Fixes #829

…troying them immediately.

- finally destroy them on navigatedFrom event
@ns-bot
Copy link

ns-bot commented Jun 15, 2017

Can one of the admins verify this patch?

2 similar comments
@ns-bot
Copy link

ns-bot commented Jun 15, 2017

Can one of the admins verify this patch?

@ns-bot
Copy link

ns-bot commented Jun 15, 2017

Can one of the admins verify this patch?

@@ -244,6 +250,7 @@ export class PageRouterOutlet { // tslint:disable-line:directive-class-suffix
this.locationStrategy._beginBackPageNavigation();
this.locationStrategy.back();
}
setTimeout(() => this.destroyQueuedCacheItems());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe that shouldn't be in navigatedFrom but in navigatingTo event handler?

@buuhuu
Copy link
Contributor Author

buuhuu commented Jun 19, 2017

Any update on that?

@vakrilov
Copy link
Contributor

Hi @buuhuu.
We've been a bit busy with the 3.1 release - so thats the reason for the delay in the review.

@Ericky14
Copy link

Ericky14 commented Jul 1, 2017

Hello.

I don't wanna bother you guys, but I just wanted to ask, is this going to be merged anytime soon?

This would solve my issue where setting clearHistory to true makes the services not load properly and thus I get errors on the next page if I try to use the services.

@ns-bot
Copy link

ns-bot commented Jul 1, 2017

Can one of the admins verify this patch?

@buuhuu
Copy link
Contributor Author

buuhuu commented Jul 1, 2017

@Ericky14 feel free to use my repo. Simply use the following reference in your package.json:

https://github.com/Buuhuu/nativescript-angular.git#781e4026bc5c8addd049cc10ae7d7069bccbc11d

Though this is not forked from master but using a detached HEAD from the 3.0.0 release tag. I have that running in our (almost live) app.

@sis0k0 sis0k0 added this to the 3.2 TBD milestone Jul 5, 2017
@@ -242,7 +248,10 @@ export class PageRouterOutlet { // tslint:disable-line:directive-class-suffix
// Add it to the new page
page.content = componentView;

page.on("navigatedFrom", (<any>global).Zone.current.wrap((args: NavigatedData) => {
page.on(Page.navigatedToEvent, () => setTimeout(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya, do we need the setTimeout here?

Copy link
Contributor Author

@buuhuu buuhuu Jul 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically we don't BUT what I want to achieve is to push the actual execution to the end of the event loop so when the view tree to destroy is huge the main thread has time to actually do other things before the clean up happens.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Copy link
Contributor

@sis0k0 sis0k0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rebase on top of master?

@sis0k0
Copy link
Contributor

sis0k0 commented Jul 12, 2017

run ci

@sis0k0
Copy link
Contributor

sis0k0 commented Jul 12, 2017

LGTM, will merge after green build 😄

@buuhuu
Copy link
Contributor Author

buuhuu commented Jul 12, 2017

We have that (almost) in production already ;)

@vchimev
Copy link
Contributor

vchimev commented Jul 12, 2017

sdkwebpack

@sis0k0 sis0k0 changed the title Asynchronously destroy items evicted on clearHistory navigation (Fixes #829) fix: asynchronously destroy items evicted on clearHistory navigation Jul 12, 2017
@sis0k0 sis0k0 merged commit 448412a into NativeScript:master Jul 12, 2017
@sis0k0 sis0k0 removed this from the 3.2 milestone Aug 2, 2017
@berchik
Copy link

berchik commented Aug 17, 2017

Still experiencing the same problem with v4.2.
When using clearHistory with navigate transition there is a white blank background.
Tested with 4.2 / 4.3.0-rc- / 4.3.0-2017-8-17-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants